package com.luozhili.Swing;

import javax.swing.*;
import java.awt.*;

/**
 * 内容窗格 JPanel
 */
public class Demo2 {
    public static void main(String[] args) {
        JFrame frame = new JFrame("Demo");

        Button button = new Button("yessssssssssssssssssssssssssssssssssss");

        JPanel jPanel = new JPanel();
        jPanel.setLayout(new BorderLayout());
        jPanel.add(button,BorderLayout.CENTER);

        frame.setContentPane(jPanel);
        frame.pack();
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
